package com.aidex.tina.domain;

import javax.validation.Valid;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import lombok.Data;
import com.aidex.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aidex.common.utils.log.annotation.FieldRemark;
import com.aidex.common.utils.log.annotation.LogField;
import com.aidex.common.annotation.Excel;

/**
 * 物料管理对象 tina_material
 * @author Stanfine
 * @email shanliang@outlook.com
 * @date 2022-06-08
 */
@Data
public class Material extends BaseEntity<Material>
{
    private static final long serialVersionUID = 1L;

    /** 名称 */
    @Excel(name = "名称")
    @NotBlank(message = "名称不允许为空")
    @LogField
    @FieldRemark(name = "名称",field = "name")
    private String name;

    /** 编号 */
    @Excel(name = "编号")
    @NotBlank(message = "编号不允许为空")
    @LogField
    @FieldRemark(name = "编号",field = "code")
    private String code;

    /** 分类 */
    @Excel(name = "分类", dictType = "tina_material_category")
    @LogField
    @FieldRemark(name = "分类",field = "category")
    private String category;

    /** 描述 */
    @Excel(name = "描述")
    @LogField
    @FieldRemark(name = "描述",field = "description")
    private String description;

    /** 销售价格 */
    @Excel(name = "销售价格")
    @LogField
    @FieldRemark(name = "销售价格",field = "salePrice")
    private BigDecimal salePrice;

    /** 采购价格 */
    @Excel(name = "采购价格")
    @LogField
    @FieldRemark(name = "采购价格",field = "purchasePrice")
    private BigDecimal purchasePrice;

    /** 库位 */
    @Excel(name = "库位")
    @LogField
    @FieldRemark(name = "库位",field = "location")
    private String location;

    public void setName(String name) 
    {
        this.name = name;
    }

    public String getName() 
    {
        return name;
    }

    public void setCode(String code) 
    {
        this.code = code;
    }

    public String getCode() 
    {
        return code;
    }

    public void setCategory(String category) 
    {
        this.category = category;
    }

    public String getCategory() 
    {
        return category;
    }

    public void setDescription(String description) 
    {
        this.description = description;
    }

    public String getDescription() 
    {
        return description;
    }

    public void setSalePrice(BigDecimal salePrice) 
    {
        this.salePrice = salePrice;
    }

    public BigDecimal getSalePrice() 
    {
        return salePrice;
    }

    public void setPurchasePrice(BigDecimal purchasePrice) 
    {
        this.purchasePrice = purchasePrice;
    }

    public BigDecimal getPurchasePrice() 
    {
        return purchasePrice;
    }

    public void setLocation(String location) 
    {
        this.location = location;
    }

    public String getLocation() 
    {
        return location;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("name", getName())
            .append("code", getCode())
            .append("category", getCategory())
            .append("description", getDescription())
            .append("salePrice", getSalePrice())
            .append("purchasePrice", getPurchasePrice())
            .append("location", getLocation())
            .append("remark", getRemark())
            .append("id", getId())
            .append("createBy", getCreateBy())
            .append("createDept", getCreateDept())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("updateIp", getUpdateIp())
            .append("version", getVersion())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
